<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入easyui 的主题样式  和  easyui 提供的图标样式 -->
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css"  charset=UTF-8/>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/icon.css"  charset=UTF-8/>
<!-- 引入jquery 和  easyui.js   中文设置js-->
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js" charset=UTF-8></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js" charset=UTF-8></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js" charset=UTF-8></script>
</head>
<script type="text/javascript">
$(function(){
	$('#dg').datagrid({
		url:'lsju',   //审批处理历史记录
		columns:[[  
				{field:'ck',checkbox:true,width:100,align:'center'},       
			    {field:'sid',title:'学生学号',width:100,align:'center'}, 
			    {field:'tname',title:'教师姓名',width:100,align:'center'},    
			    {field:'cname',title:'课程名称',width:100,align:'center'},
			    {field:'score',title:'分数',width:40,align:'center'},
			    {field:'nr',title:'申请内容',width:100,align:'center'},
			    {field:'zt',title:'状态',width:100,align:'center'},
			    {field:'sqsj',title:'申请时间',width:200,align:'center'},
			    {field:'sj',title:'处理时间',width:200,align:'center'},
		]],
		pageSize:5,
	    pagePosition:'bottom',
	    pagination:true,
	    pageList:[10],
	    rownumbers:true,
	    toolbar: [{
	    	iconCls: 'icon-remove',
			text:'删除记录',
			handler: function(){
				var  ck = $('#dg').datagrid('getSelections');
				if(ck.length>0){
					$("#deletejl").dialog("open").dialog('setTitle', '删除处理记录');
					$("#yes").linkbutton({
						onClick:function(){
							var id = [];
							for (var i = 0; i < ck.length; i++) {
								id.push(ck[i].id);
							}
							$.ajax({
								url:'deletejl',
								type:'post',
								data:{'id':id},
								datatype:'text',
								success:function(data){
									if(data=='1'){
										$.messager.alert('success','删除成功！','info');
										$("#deletejl").dialog("close");
										$('#dg').datagrid('reload');
									}else{
										$.messager.alert('error','删除失败！','info');
										$("#deletejl").dialog("close");
										$('#dg').datagrid('reload');
									}
								}
							})	
							
						}
					})
				}else{
					$.messager.alert('MSG','请至少选择一个！','info');
				}
			} 	
	    }]
	})   
})
</script>
<body>
					<!--  审批记录表 -->
	<table id="dg" ></table>
	 <!-- 删除彈出窗口 -->
  		<div id="deletejl" class="easyui-dialog"  closed="true" buttons="#dlg3-buttons" > 
		 <div  style="width: 100px;height: 30px;margin-top: 10px;margin-left: 30px">
	  		<p>确认删除吗？</p>
	  	 </div>
       <div id="dlg3-buttons">
        <button id="yes"  class="easyui-linkbutton"  iconcls="icon-save">确认</button>
        <a id="no" class="easyui-linkbutton" onclick="javascript:$('#deletejl').dialog('close')"
         iconcls="icon-cancel">取消</a>
        </div>
        </div>
</body>
</html>